﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace BanquetPortion.Migrations
{
    public partial class InitDataBase : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "banquetGiftMoneyBook",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CreatedBy = table.Column<int>(nullable: false),
                    CreatedDataTime = table.Column<DateTime>(nullable: false),
                    BanquetType = table.Column<int>(nullable: false),
                    GiveOrGet = table.Column<int>(nullable: false),
                    BanquetGiftPeopleId = table.Column<int>(nullable: false),
                    Money = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Description = table.Column<string>(maxLength: 200, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_banquetGiftMoneyBook", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "banquetGiftPeople",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CreatedBy = table.Column<int>(nullable: false),
                    CreatedDataTime = table.Column<DateTime>(nullable: false),
                    GiftPeopleName = table.Column<string>(maxLength: 20, nullable: false),
                    Gender = table.Column<int>(nullable: false),
                    Addreass = table.Column<string>(maxLength: 100, nullable: true),
                    Description = table.Column<string>(maxLength: 200, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_banquetGiftPeople", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "dataDictionary",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CreatedBy = table.Column<int>(nullable: false),
                    CreatedDataTime = table.Column<DateTime>(nullable: false),
                    ParentId = table.Column<int>(nullable: false),
                    DataDictionaryName = table.Column<string>(maxLength: 50, nullable: false),
                    Description = table.Column<string>(maxLength: 200, nullable: false),
                    SortIndex = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_dataDictionary", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "banquetGiftMoneyBook");

            migrationBuilder.DropTable(
                name: "banquetGiftPeople");

            migrationBuilder.DropTable(
                name: "dataDictionary");
        }
    }
}
